<template>
  <div>
      <!-- 轮播图 -->

          <!-- 轮播图 -->
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
  <van-swipe-item v-for="item in img" :key="item.id" >
      <img :src="'http://localhost:3000' + item.img">
  </van-swipe-item>
</van-swipe>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data(){
    return {
      img:[]
    }
  },
mounted(){
  axios({
    url:"/api/getbanner",
    method:"get",
  }).then(res=>{
    // console.log(res);
    this.img = res.data.list;
  })
}
}
</script>

<style scoped>
  img{
    width: 100%;
    height: 100%;
  }
  .my-swipe{
    height: 4rem;
  }
</style>